<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
    <div id="app">{{ message | capi }}</div>
    <div id="app2">{{ message2 | capi }}</div>
    <script>
        Vue.filter('capi',function(str){
            const first = str.charAt(0).toUpperCase()
            const other = str.slice(1)
            return first + other
        })
    </script>

    <script>
        const vm = new Vue({
            el:'#app',
            data: {
                message: 'hello vue'
            },
         
            filters: {
              
                capi(val) {
                   
                    const first= val.charAt(0).toUpperCase()
                 
                    const other = val.slice(1)
                    return first + other
                    
                }
            }
        })

        const vm2 = new Vue({
            el:'#app2',
            data: {
                message2: 'hello wbc'
            },
        })
    </script>
</body>
</html>